
       $(function(){
            $('#dowebok').fullpage({
                sectionsColor: ['#1bbc9b', '#4BBFC3', '#7BAABE', '#f90'],
                anchors: ['page1', 'page2', 'page3', 'page4','page5'],
                menu: '#menu'
            });
        });

        $(document).ready(function () {
            var i = 0;
            var timer;
        
            $('.item').eq(0).show().siblings('.item').hide();
            
            function show() {
                $('.item').eq(i).fadeIn(300).siblings('.item').fadeOut(300);
                $('.tab').eq(i).addClass('actives').siblings('.tab').removeClass('actives');
                }
        
            function showTime() {
                timer = setInterval(function () {
                    show();
                    i++;
                    
                    if(i==5){
                        i=0;
                    }
        
                },3000);
                
            }
            showTime();
        
            $('.tab').hover(function () {
                i = $(this).index();
                show();
                clearInterval(timer);
            },function(){
                showTime();
             });
        
             $('.prev').click(function () {
                 clearInterval(timer);
                 if(i == 0){
                     i = 5
                 }
                 i--;
                 show();
                 showTime();
             });
        
             $('.next').click(function () {
                clearInterval(timer);
                if(i == 4){
                    i = -1;
                }
                i++;
                show();
                showTime();
            });
        });
     


        function getTime() {
            var myDate = new Date();
            var myYear = myDate.getFullYear(); //获取完整的年份(4位,1970-????)
            var myMonth = myDate.getMonth() + 1; //获取当前月份(0-11,0代表1月)
            var myToday = myDate.getDate(); //获取当前日(1-31)
            var myDay = myDate.getDay(); //获取当前星期X(0-6,0代表星期天)
            var myHour = myDate.getHours(); //获取当前小时数(0-23)
            var myMinute = myDate.getMinutes(); //获取当前分钟数(0-59)
            var mySecond = myDate.getSeconds(); //获取当前秒数(0-59)
            var week = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
            var nowTime;

            nowTime = myYear + '年' + fillZero(myMonth) + '月' + fillZero(myToday) + '日' + '  ' + fillZero(myHour) + ':' +
                fillZero(myMinute) + ':' + fillZero(mySecond) + '  ' + week[myDay] + '  ';
            //console.log(nowTime);
            $('#time').html(nowTime);
        };
        
        function fillZero(str) {
            var realNum;
            if (str < 10) {
                realNum = '0' + str;
            } else {
                realNum = str;
            }
            return realNum;
        }
        setInterval(getTime, 1000);


        var xin = true,
    yin = true;
var step = 1;
var delay = 10;
var $obj;
$(function() {
    $obj = $("#imgDiv");
    var time = window.setInterval("move()", delay);
    $obj.mouseover(function() {
        clearInterval(time)
    });
    $obj.mouseout(function() {
        time = window.setInterval("move()", delay)
    });
});

function move() {
    var left = $obj.offset().left;
    var top = $obj.offset().top;
    var L = T = 0; //左边界和顶部边界
    var R = $(window).width() - $obj.width(); // 右边界
    var B = $(window).height() - $obj.height(); //下边界
    if (left < L) {
        xin = true; // 水平向右移动
    }
    if (left > R) {
        xin = false;
    }
    if (top < T) {
        yin = true;
    }
    if (top > B) {
        yin = false;
    }
    left = left + step * (xin == true ? 1 : -1);
    top = top + step * (yin == true ? 1 : -1);
    // 给div 元素重新定位
    $obj.offset({
        top: top,
        left: left
    })
}
$(function() {
    $("#a").click(function() {
        var b = $("#a").parent();
        $(b).remove();
    })
})
$("#imgDiv").draggable();



$(function() {
    $(".btn_top").hide();
    $(".btn_top").live("click",function(){
        $('html, body').animate({scrollTop: 0},300);return false;
    })
    $(window).bind('scroll resize',function(){
        if($(window).scrollTop()<=300){
            $(".btn_top").hide();
        }else{
            $(".btn_top").show();
        }
    })
})
